<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>06-Promise自定义封装-resolve和reject方法封装</title>
  <!-- <script src="./06-Promise自定义封装-resolve和reject方法封装.js"></script> -->
</head>
<body>
  <script>
    // let p1 = Promise.resolve('hello p1');
    // console.log(p1);
    // let p2 = Promise.resolve(new Promise((resolve,reject)=>{
    //   setTimeout(() => {
    //     resolve('hello p2')
    //   }, 2000);
    // }));
    // console.log(p2);
    // let p3 = Promise.resolve(Promise.resolve('hello p3'));
    // console.log(p3);
    // let p4 = Promise.reject(new Promise((resolve,reject)=>{
    //   setTimeout(() => {
    //     reject('hello p4')
    //   }, 2000);
    // }));
    // console.log(p4);
    // let p5 = Promise.reject('hello p5');
    // console.log(p5);
    // console.log(Promise);
    // let p6 = Promise.reject('hello p6');
    // console.log(p6);
    // p6.catch(error=>{
    //   console.log(error);
    // })
    // let p7 = Promise.reject('hello p7');
      // let p7 = Promise.reject(new Promise((resolve,reject)=>{
      //   // reject('hello p7')
      //   resolve('hello p7')
      // }));
      // console.log(p7);
      // p7.catch(error=>{
      //   console.log('catch -1',error);
      //   return error
      // }).catch(error=>{
      //   console.log('catch-2',error);
      // })
  </script>
</body>
</html>